export default {
  methods: {
    navigateToEnterpriseAnalysis(row, key = 'districtCode') {
      if (row[key]) {
        const query = {
          [key]: row[key]
        }
        /**
         * enterpriseCode={tenantId}&entepriseId={enterpriseId}
         * e.g. enterpriseCode=28&enterpriseId=6ed8f2ba-28cd-4cd6-91a2-051725daa0c6
        */
        if (key === 'enterpriseCode') {
          query.enterpriseId = row.enterpriseId
        }
        this.$router.push({
          name: 'EnterpriseAnalysis',
          query,
        })
      }
    },
  }
}
